package com.shitou.shitoucart.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.netflix.ribbon.proxy.annotation.Http;
import com.shitou.shitoucart.vo.CartVo;
import com.shitou.shitoucart.vo.RemoveCartVo;
import com.shitou.shitoucommons.utils.PageUtils;
import com.shitou.shitoucart.entity.CartEntity;
import com.shitou.shitoucommons.utils.RespBean;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * 购物车-cat
 *
 * @author shitouren
 * @email 3076767823@qq.com
 * @date 2023-03-19 17:10:02
 */
public interface CartService extends IService<CartEntity> {

    PageUtils queryPage(Map<String, Object> params);


    /**
     * 添加购物车
     * @param cartVo
     * @see CartVo
     * @return
     */
    RespBean addCart(CartVo cartVo, HttpServletRequest request, HttpServletResponse response);


    /**
     * 获得用户的购物车
     * @param memberId 会员id
     * @return
     */
    RespBean getMemberCart(long memberId, HttpServletRequest request, HttpServletResponse response);


    /**
     * 移除用户的购物车
     * @param cartId 购物车id
     * @return
     */
    RespBean removeMemberCart(long cartId, long memberId);


    /**
     * 用后搜索自己的购物车
     * @param searchInfo 搜索内容
     * @param memberId 会员id
     * @return
     */
    RespBean searchCart(String searchInfo, long memberId, HttpServletRequest request, HttpServletResponse response);


}

